﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Fcdbas.WinUI.Common;
using Fcdbas.Biz;

namespace Fcdbas.WinUI.Forms
{
    public partial class dlgAddApprovalTemplate : BaseForm
    {
      //  private string module;
        private string lu_name;
        private string objid;
        public dlgAddApprovalTemplate(string lu_name,string objid)
        {
            InitializeComponent();
          //  this.module = module;
            this.lu_name = lu_name;
            this.objid = objid;
        }

        private void dlgAddApprovalTemplate_Load(object sender, EventArgs e)
        {
            //List<approval_profile> lsAppProfile = ApprovalRouting.DisplayApprovalProfile();
            this.leApprovTemplate.Properties.DataSource = ApprovalRouting.DisplayApprovalProfile();
        }
        private void leApprovTemplate_EditValueChanged(object sender, EventArgs e)
        {
            txtDescription.Text = leApprovTemplate.GetColumnValue("description").ToString();
        }
        public string ApprovalProfileID
        {
            get
            {
                return leApprovTemplate.Text;
            }
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            ApprovalRouting.ApprovalRouting_CreateRouting(lu_name, objid, ApprovalProfileID);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void BtnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
